
/**
 * 
 * This class is an extension for the burning forest simulation
 * adding probability for neighbor seeding 
 * 
 * @author root
 *
 */
public class BurningForstSimulationExtended extends BurningForstSimulation {
	public double s_neighborSeedingProb; //s
	private RulesEngineExtended exEngine;
	
	public BurningForstSimulationExtended() {
		exEngine=new RulesEngineExtended();
	}
	@Override
	public void evolveToNextGeneration() {
		//excluding the boundries
		TreeCell [] [] newMatrix = duplicateMatrix();
		for (int i = 1; i < newMatrix.length-1; i++) {
			for (int j = 1; j < newMatrix[i].length-1; j++) {
				exEngine.decideCellState(newMatrix[i][j]
				                       ,matrix[i-1][j],matrix[i+1][j]
				                       ,matrix[i][j-1],matrix[i][j+1]
				                       ,p_growNewPlantProb,g_combustibilityProb,f_lightningStrikeProb,s_neighborSeedingProb);		
			}
		}
		matrix=newMatrix;
		generationCount++;
	}
}
